import Http from '../../http';
import {download} from '../../../library/commonUtil';

export const loginApi = function(loginForm: any) {
    return Http.post('/sys-user/login', loginForm)
}

export const loginOutApi = function() {
    return Http.post('/sys-user/login-out')
}

export const pageApi = function(param: any) {
    return Http.get('/sys-user/page', param)
}

export const exportApi = function(param: any) {
    download('用户信息.xlsx','/sys-user/export', param);    
}

export const saveApi = function(param: any) {
    return Http.post('/sys-user/save', param)
}

export const removeApi = function(id: number) {
    return Http.post('/sys-user/remove/'+id)
}

export const infoApi = function(id: number) {
    return Http.get('/sys-user/info/'+id)
}

export const updateStateApi = function(param: any) {
    return Http.post('/sys-user/update-state', param)
}

export const resetPasswordApi = function(param: any) {
    return Http.post('/sys-user/reset-password', param)
}

export const assigningRolesApi = function(param: any) {
    return Http.post('/sys-user/assigning-roles', param)
}

export const queryAssignedRoleApi = function(id: number) {
    return Http.get('/sys-user/assigned-role/'+id)
}

export const getCaptchaImgApi = function(clientId: string) {
    return Http.get('/sys-user/captcha-img/'+clientId)
}



